﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPageAdmin.master" AutoEventWireup="true" CodeFile="AllUser.aspx.cs" Inherits="Admin_AllUser" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphHeader" Runat="Server">
    <meta content="Test"/>
    <script language="javascript">

        function SelectAllCheckboxes(spanChk) {

            // Added as ASPX uses SPAN for checkbox

            var oItem = spanChk.children;
            var theBox = (spanChk.type == "checkbox") ?
        spanChk : spanChk.children.item[0];
            xState = theBox.checked;
            elm = theBox.form.elements;

            for (i = 0; i < elm.length; i++)
                if (elm[i].type == "checkbox" &&
              elm[i].id != theBox.id) {
                    //elm[i].click();

                    if (elm[i].checked != xState)
                        elm[i].click();
                    //elm[i].checked=xState;

                }
        }
</script>

 
</asp:Content>

 
<asp:Content ID="Content3" runat="server" 
    contentplaceholderid="ContentPlaceHolder1">
    <div id="body-wrapper">
        <!-- Wrapper for the radial gradient background -->
             <div id="sidebar">
                 <div id="sidebar-wrapper">
                     <!-- Sidebar with logo and menu -->
			
			         <h1 id="sidebar-title">
                         <a href="#">Simpla Admin</a></h1>
		  
			<!-- Logo (221px wide) -->
			         <a href="#">
                     <img id="logo" src="resources/images/logo.png" alt="Simpla Admin logo" /></a>
		  
			<!-- Sidebar Profile links -->
			         <div id="profile-links">
                         Hello, <a href="#" title="Edit your profile">John Doe</a>, you have
                         <a href="#messages" rel="modal" title="3 Messages">3 Messages</a><br />
                         <br /><a href="#" title="View the Site">View the Site</a> |
                         <a href="#" title="Sign Out">Sign Out</a>
                     </div>
                     <ul id="main-nav">
                         <!-- Accordion Menu -->
				
				         <li><a href="http://www.google.com/" class="nav-top-item no-submenu"> <!-- Add the class "no-submenu" to menu items with no sub menu -->
						     Home </a></li>
                         <li><a href="#" class="nav-top-item current"> <!-- Add the class "current" to current menu item -->
					         Bài Viết </a>
                             <ul>
                                 <li><a href="#">Tất Cả Bài Viết</a></li>
                                 <li><a class="current" href="#">Viết Bài Mới</a></li> <!-- Add class "current" to sub menu items also -->
						         <li><a href="#">Quản Lý Chuyên Mục</a></li>
                                 <li><a href="#">Quản Lý Tags</a></li>
                             </ul>
                         </li>
                         <li><a href="#" class="nav-top-item">Pages </a>
                             <ul>
                                 <li><a href="#">Create a new Page</a></li>
                                 <li><a href="#">Manage Pages</a></li>
                             </ul>
                         </li>
                         <li><a href="#" class="nav-top-item">Image Gallery </a>
                             <ul>
                                 <li><a href="#">Upload Images</a></li>
                                 <li><a href="#">Manage Galleries</a></li>
                                 <li><a href="#">Manage Albums</a></li>
                                 <li><a href="#">Gallery Settings</a></li>
                             </ul>
                         </li>
                         <li><a href="#" class="nav-top-item">Quản Lý Tài Khoản </a>
                             <ul>
                                 <li><a href="#">Tất Cả Tài Khoản </a></li>
                                 <li><a href="ThemTaiKhoan.aspx">Thêm Tài Khoản</a></li>
                                 <li><a href="#">Đổi Mật Khẩu</a></li>
                             </ul>
                         </li>
                         <li><a href="#" class="nav-top-item">Settings </a>
                             <ul>
                                 <li><a href="#">General</a></li>
                                 <li><a href="#">Design</a></li>
                                 <li><a href="#">Your Profile</a></li>
                                 <li><a href="#">Users and Permissions</a></li>
                             </ul>
                         </li>
                     </ul>
                     <!-- End #main-nav -->
			
			         <div id="messages" style="display: none">
                         <!-- Messages are shown when a link with these attributes are clicked: href="#messages" rel="modal"  -->
				
				         <h3>
                             3 Messages</h3>
                         <p>
                             <strong>17th May 2009</strong> by Admin<br />Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue.
                             <small><a href="#" class="remove-link" title="Remove message">Remove</a></small>
                         </p>
                         <p>
                             <strong>2nd May 2009</strong> by Jane Doe<br />Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est.
                             <small><a href="#" class="remove-link" title="Remove message">Remove</a></small>
                         </p>
                         <p>
                             <strong>25th April 2009</strong> by Admin<br />Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue.
                             <small><a href="#" class="remove-link" title="Remove message">Remove</a></small>
                         </p>
                         <form action="#" method="post">
                         <h4>
                             New Message</h4>
                         <fieldset>
                             <textarea class="textarea" name="textfield" cols="79" rows="5"></textarea>
                         </fieldset>
                         <fieldset>
                             <select name="dropdown" class="small-input">
                                 <option value="option1">Send to...</option>
                                 <option value="option2">Everyone</option>
                                 <option value="option3">Admin</option>
                                 <option value="option4">Jane Doe</option>
                             </select>
                             <input class="button" type="submit" value="Send" />
                         </fieldset>
                         </form>
                     </div>
                     <!-- End #messages -->
			
		         </div>
        </div>
        <!-- End #sidebar -->
             <div id="main-content">
                 <noscript>
<!-- Show a notification if the user has disabled javascript -->
				<div class="notification error png_bg">
					<div>
						Javascript is disabled or is not supported by your browser. Please <a href="http://browsehappy.com/" title="Upgrade to a better browser">upgrade</a> your browser or <a href="http://www.google.com/support/bin/answer.py?answer=23852" title="Enable Javascript in your browser">enable</a> Javascript to navigate the interface properly.
					</div>
				</div>
			     </noscript>
                 <h2>
                     Welcome John</h2>
                 <p id="page-intro">
                     What would you like to do?</p>
                 <ul class="shortcut-buttons-set">
                     <li><a class="shortcut-button" href="#"><span>
                         <img src="resources/images/icons/pencil_48.png" alt="icon" /><br />Write an Article
                         </span></a></li>
                     <li><a class="shortcut-button" href="#"><span>
                         <img src="resources/images/icons/paper_content_pencil_48.png" alt="icon" /><br />Create a New Page
                         </span></a></li>
                     <li><a class="shortcut-button" href="#"><span>
                         <img src="resources/images/icons/image_add_48.png" alt="icon" /><br />Upload an Image
                         </span></a></li>
                     <li><a class="shortcut-button" href="#"><span>
                         <img src="resources/images/icons/clock_48.png" alt="icon" /><br />Add an Event
                         </span></a></li>
                     <li><a class="shortcut-button" href="#messages" rel="modal"><span>
                         <img src="resources/images/icons/comment_48.png" alt="icon" /><br />Open Modal
                         </span></a></li>
                 </ul>
                 <!-- End .shortcut-buttons-set -->
                 <div class="clear">
                 </div>
                 <!-- End .clear -->
                 <div class="content-box">
                     <!-- Start Content Box -->
                     <div class="content-box-header">
                         <h3>
                             Nội Dung</h3>
                         <ul class="content-box-tabs">
                             <li><a href="#tab1" class="default-tab">Table</a></li> <!-- href must be unique and match the id of target div -->
						     <li><a href="#tab2">Forms</a></li>
                         </ul>
                         <div class="clear">
                         </div>
                     </div>
                     <!-- End .content-box-header -->
				
				     <div class="content-box-content">
                         <div class="tab-content default-tab" id="tab1">
                             <!-- This is the target div. id must match the href of this div's tab -->
					  
    <table>
        <tr>
            <td>
                <div class="fl" style="margin:20px;">
                    <asp:LinkButton ID="lbAllUser" runat="server" CssClass="alluser" 
                        onclick="lbAllUser_Click"  >All User</asp:LinkButton> |
                    <asp:LinkButton ID="lbAdmin" runat="server" CssClass="alluser" 
                        onclick="lbAdmin_Click">Admin</asp:LinkButton> |
                    <asp:LinkButton ID="lbQuanLy" runat="server" CssClass="alluser" 
                        onclick="lbQuanLy_Click">Quản Lý</asp:LinkButton> |
                     <asp:LinkButton ID="lbThanhvien" runat="server" CssClass="alluser" 
                        onclick="lbThanhvien_Click">Thành Viên</asp:LinkButton> 
                </div>
                <div class="cl fl">
                <asp:DropDownList ID="DropDownList1" runat="server">
                    <asp:ListItem Value="0">Chức Năng</asp:ListItem>
                    <asp:ListItem Value="1">Xóa Tài Khoản</asp:ListItem>
                </asp:DropDownList>
                 <asp:Button ID="btnXoa" runat="server" Text="Thực Hiện" CssClass="button" 
                        onclick="btnXoa_Click" />
                 
                 <asp:DropDownList ID="DropDownList2" runat="server" CssClass="dropdowlist">
                    <asp:ListItem Value="0">Lọc Tài Khoản</asp:ListItem>
                    <asp:ListItem Value="1">All User</asp:ListItem>
                    <asp:ListItem Value="2">Admin</asp:ListItem>
                     <asp:ListItem Value="3">Quản Lý</asp:ListItem>
                     <asp:ListItem Value="4">Thành Viên</asp:ListItem>
                </asp:DropDownList>
                 <asp:Button ID="btnLoc" runat="server" Text="Thực Hiện" CssClass="button" 
                        onclick="btnLoc_Click" />
                </div>
               
             
            </td>
           </tr>
           <tr>
               
                <td>
                    <asp:ScriptManager ID="ScriptManager1" runat="server">
                    </asp:ScriptManager>
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                    <asp:LinkButton ID="btnAddCustomer" Text="Add Customer" runat="server" OnClientClick="openDialogAndBlock('Add Customer', 'btnAddCustomer')" CausesValidation="false" onclick="btnAddCustomer_Click"></asp:LinkButton>
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                        BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
                        CellPadding="3" Width="898px" onrowdatabound="GridView1_RowDataBound" 
                        OnRowCreated="GridView1_OnRowCreated" AllowPaging="true" PageSize="15" 
                        onpageindexchanging="GridView1_PageIndexChanging" 
                            onrowcommand="GridView1_RowCommand"  > 
                    <Columns>
                    
                        <asp:BoundField DataField="Username" HeaderText="Tên Tài Khoản" />
                        <asp:BoundField DataField="FullName" HeaderText="Họ Tên" />
                        <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
                        <asp:BoundField DataField="RoleCode" HeaderText="Quyền Hạn" 
                            SortExpression="RoleCode" />
                        <asp:BoundField DataField="Status" HeaderText="Tình Trạng" 
                            SortExpression="Status" />
                           
                   <asp:TemplateField HeaderText="Select">
                    <ItemTemplate>
                       <asp:CheckBox ID="chkSelect" runat="server" />
                       <asp:LinkButton ID="LinkButton1" CommandArgument='<%# Eval("Username") %>'  CommandName="Delete" runat="server"> Delete</asp:LinkButton>
                    </ItemTemplate>
                   <HeaderTemplate>
                      <input id="chkAll" onclick="javascript:SelectAllCheckboxes(this);" 
                                  runat="server" type="checkbox" />
                    </HeaderTemplate>
                   </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="White" ForeColor="#000066" />
                    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                    <RowStyle ForeColor="#000066" />
                    <SelectedRowStyle BackColor="#3399FF" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                    <SortedAscendingHeaderStyle BackColor="#007DBB" />
                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                    <SortedDescendingHeaderStyle BackColor="#00547E" />
                 </asp:GridView>
                 </ContentTemplate>
                  </asp:UpdatePanel>
                </td>
           </tr>
        
        
        </table>
                         </div>
                         <!-- End #tab1 -->
					
					     <div class="tab-content" id="tab2">
                             <form action="#" method="post">
                             <div class="clear">
                             </div>
                             <!-- End .clear -->
							
						     </form>
                         </div>
                         <!-- End #tab2 -->        
					
				     </div>
                     <!-- End .content-box-content -->
				
			     </div>
                 <!-- End .content-box -->
        
             </div>
    </div>
</asp:Content>




